#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@File    : CuiMgr.py
@Desc    : 
@Version : 1.0
@Author  : echohelper 
@Email   : echohelper@qq.com
@WebSite : www.github.com/echohelper
@Time    : 2021/09/06 16:48:21
'''
# Start typing your code from here

from module.childui.ICuiBase import *


class CuiMgr:
    cmd2Ui = {}

    def __new__(cls):
        if not hasattr(cls, 'instance'):
            cls.instance = super(CuiMgr, cls).__new__(cls)
        return cls.instance

    def setCmdUi(self, cmd:str, ui:ICuiBase) -> None:
        print('setCmdUi ' + cmd)
        self.cmd2Ui[cmd] = ui

    def getCmdUi(self, cmd:str) -> ICuiBase:
        print('getCmdUi ' + cmd)
        return self.cmd2Ui[cmd]
